﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebEntities;
using WebsiteUI.Extensions;
using com.subb.WebInformation;

namespace WebsiteUI.Controllers
{
    /// <summary>
    /// 行业信息 栏目
    /// </summary>
    public class InformationController : Controller
    {
        [OutputCache(CacheProfile = "Cache15Mins")]
        public ActionResult Index()
        {
            //获取垃圾分类信息前20条
            WI_NewsDAL ndal = new WI_NewsDAL();
            List<WI_News> rubsortList = ndal.GetAllNewsByPCataID(CommonFn.GetContentID("RubbishSortID"), 0, 20);
            //List<WI_News> rubsortList = CommonFn.GetNews("RubbishSortID", "InfoPage_RubSort", 0, 20, 600);
            ViewBag.RubbishSortID = CommonFn.GetContentID("RubbishSortID");
            ViewBag.RubSortList = rubsortList;

            //获取处理分类信息前7条
            //List<WI_News> procsortList = CommonFn.GetNews("ProcSortID", "InfoPage_ProcSort", 0, 7, 600);
            List<WI_News> procsortList = ndal.GetAllNewsByPCataID(CommonFn.GetContentID("ProcSortID"), 0, 7);
            ViewBag.ProcSortID = CommonFn.GetContentID("ProcSortID");
            ViewBag.ProcSortList = procsortList;

            //获取环境卫生信息前2条
            //List<WI_News> envhealList = CommonFn.GetNews("EnvHealthID", "InfoPage_EnvHealth", 0, 2, 600);
            List<WI_News> envhealList = ndal.GetAllNewsByPCataID(CommonFn.GetContentID("EnvHealthID"), 0, 2);
            ViewBag.EnvHealthID = CommonFn.GetContentID("EnvHealthID");
            ViewBag.EnvHealthList = envhealList;

            //获取政策法规信息前5条
            //List<WI_News> lawList = CommonFn.GetNews("LawID", "InfoPage_Law", 0, 5, 600);
            List<WI_News> lawList = ndal.GetAllNewsByPCataID(CommonFn.GetContentID("LawID"), 0, 5);
            ViewBag.LawID = CommonFn.GetContentID("LawID");
            ViewBag.LawList = lawList;

            //获取垃圾储运信息前3条
            //List<WI_News> rubstoreList = CommonFn.GetNews("RubbishStoreID", "InfoPage_RubStore", 0, 3, 600);
            List<WI_News> rubstoreList = ndal.GetAllNews(CommonFn.GetContentID("RubbishStoreID"), 0, 3);
            ViewBag.RubbishStoreID = CommonFn.GetContentID("RubbishStoreID");
            ViewBag.RubStoreList = rubstoreList;

            //获取标准规范信息前3条
            //List<WI_News> stdList = CommonFn.GetNews("StandardID", "InfoPage_Std", 0, 3, 600);
            List<WI_News> stdList = ndal.GetAllNews(CommonFn.GetContentID("StandardID"), 0, 3);
            ViewBag.StandardID = CommonFn.GetContentID("StandardID");
            ViewBag.StdList = stdList;

            //获取垃圾分类栏目的下级栏目前10条
            WI_NewsCataDAL ncdal = new WI_NewsCataDAL();
            //List<WI_NewsCata> rubCataList = CommonFn.GetNewsCata(CommonFn.GetContentID("RubbishSortID"), "InfoPage_RubSubCata", 0, 10, 600);
            List<WI_NewsCata> rubCataList = ncdal.GetAllNewsCataByPcataId(CommonFn.GetContentID("RubbishSortID"), 0, 10);
            ViewBag.RubCataList = rubCataList;

            //获取处理分类栏目的下级栏目前10条
            //List<WI_NewsCata> procCataList = CommonFn.GetNewsCata(CommonFn.GetContentID("ProcSortID"), "InfoPage_ProcessSubCata", 0, 10, 600);
            List<WI_NewsCata> procCataList = ncdal.GetAllNewsCataByPcataId(CommonFn.GetContentID("ProcSortID"), 0, 10);
            ViewBag.ProcCataList = procCataList;

            //获取环境卫生栏目的下级栏目前10条
            //List<WI_NewsCata> envCataList = CommonFn.GetNewsCata(CommonFn.GetContentID("EnvHealthID"), "InfoPage_EnvSubCata", 0, 10, 600);
            List<WI_NewsCata> envCataList = ncdal.GetAllNewsCataByPcataId(CommonFn.GetContentID("EnvHealthID"), 0, 10);
            ViewBag.EnvCataList = envCataList;

            //获取政策法规栏目的下级栏目前10条
            //List<WI_NewsCata> lawCataList = CommonFn.GetNewsCata(CommonFn.GetContentID("LawID"), "InfoPage_LawSubCata", 0, 10, 600);
            List<WI_NewsCata> lawCataList = ncdal.GetAllNewsCataByPcataId(CommonFn.GetContentID("LawID"), 0, 10);
            ViewBag.LawCataList = lawCataList;

            return View();
        }
    }
}
